/*
package com.laowang.framework.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

*/
/**
 * @Author: laowang
 * @Date: 2020/10/19
 * @Description  订阅者
 *//*

@Component
public class RedisMessageListener implements MessageListener {

  */
/*@Autowired
  private StringRedisTemplate stringRedisTemplate;
  *//*


  @Autowired
  private StringRedisTemplate stringRedisTemplate;


  @Override
  public void onMessage(Message message, byte[] pattern) {
    byte[] body = message.getBody();
    String msgBody = (String) stringRedisTemplate.getValueSerializer().deserialize(body);
    System.out.println(msgBody);
    byte[] channel = message.getChannel();
    String msgChannel = (String) stringRedisTemplate.getValueSerializer().deserialize(channel);
    System.out.println(msgChannel);
    String msgPattern = new String(pattern);
    System.out.println(msgPattern);

    //System.out.println("接收数据:"+message.toString());
    //System.out.println("订阅频道:"+new String(message.getChannel()));
  }
}
*/
